umsfandomcom-20200214-history
User blog:Nerdington/Ned's Guide to Command Selectors
To respond to the /kill @a incident, I have personally read into the Minecraft's command page and taken the quiz (which in itself is a pretty good guide to learning command selectors). So what are command selectors anyway? Command selectors are essentially specific conditions that allows the executor (the OPs in this case) to target specific things, such as players or entities. There are multiple selector variables that one can use, in which they are: *'@p' = nearest player *'@r '= random player *'@a' = all player *'@e' = all entities (including players) *@s = the entity executing the commands (which in itself is confusing and I'm not going to dive into this one because we're only going over the basics) Notice how the first three variables (p, r, a) target only players, while variable e targets entities and players. Can we target more specific things? I don't want to get rid of my paintings from my museum! Yes you can! We use selector arguments to refine our selections further from the selectors. We do @=,=,… ''to refine our selections. Here are some arguments we can use: *'type —''' 'selects only a specific entity type, ie. only cows, or pigs, or minecarts. We use entity IDs (pre-1.13 list | 1.13+ list ) to define the value (note that these entity IDs are ''case sensitive). **Eg. to target only minecarts, we do @etype=minecart. To target only squids, we do @etype=squid. *'c '— selects only a specified number of targets, usually in order from the distance of the executor. **Eg. to target 3 creepers, we do @etype=creeper,c=3 **''NOTE: the c argument only exists pre-1.13. For post 1.13, we use limit=.'' *'r '— selects only targets within specified radius from the executor. **Eg. to target entities only within 3 blocks radius from the executor, we do @er=3 **We can select targets further than the specified radius, using '''rm. Think of it like radius min, while r 'is radius max. ***Eg. to target entities more than 3 blocks away, but within 6 blocks, we do @erm=3,r=6 ***Does this sound confusing? Have a graph I made. There are more arguments we can do, but I won't dive in because these are sufficient enough for y'all to use. Check more here . '''I want to target named pigs called "Markiplier", that is within the radius of 20, looking west, hates carrots-' Alright I get it, you want to combine a bunch of arguments. Use commas. *For this example, we do @etype=pig,name=Markiplier,r=20,y_rotation=90. There's no way you can target pigs that "hate" carrots. '''I have a lot of villagers and a lot of other animals in an area; I only wanted to target the animals without touching the villagers. How?!? Calm your tits. So you want to target "anything other than X". Use exclamation marks! *For this example, we do @etype=!villager. That simple. I don't understand question 13: What does execute at ~ ~ ~ do? I hate this question because it's hard to explain. /execute "is a versatile command that executes other commands in a variety of scenarios", and in the case of /execute at ~ ~ ~, it targets the command at the position of the executor. I'm sorry but with I cannot comprehend Minecraft wiki page on /execute, so I think you should go read some part of it to understand. Watch some videos too. PRECAUTIONS and things you should do to avoid mistakes #When you have a typo in your command selectors, chances are: you're going to screw up. Test your commands in your personal test world before go ahead and do it in the server. #*I have personally made mistakes of my own in the server itself. Don't beat yourself over it. Learn it, and try again safely. That's why irl we have OSHA and NTSB. We make mistakes and then we learn from it to prevent ourselves from doing it again. #If you're not entirely sure if your commands are gonna work, ask a professional. #*We have some redstoners in the server. Go ask them (Kim is pretty good, Slendi is knowledgable, MTM is also good but most of the time he's unavailable). Hopefully by this point you have known enough selectors for your commands. If there are any mistakes let me know. Category:Blog posts